CAN Setup

A CAN (Controller Area Network) Bus is a robust vehicle bus standard widely used in the aviation sector. Autopilot 1x is fitted with two CAN buses that can be configured independently.

The structure of a CAN message can be seen in the following image:

../../../_images/can_structure.png

CAN message structure

Only the ID is introduced in the system, the rest of the message layout is already coded. The data field is the one build by the user to send, and parsed when received.

The baud rate of both CAN buses can be configured in the Mailboxes panel.

The steps to be followed from the moment a CAN message arrives at or is sent from the Autopilot 1x are described in the CAN communication - Integration examples section of this manual.

Configuration

This panel allows the configuration of communications between different devices.

../../../_images/can_configuration.png

Configuration panel

In this panel, the user can find the same ‘columns’ (Priority, Producer, Consumer and Bit) as in the I/O Setup panel. In addition, the process for configuring producers and consumers is also the same as described in the I/O Setup - Input/Output section.

Warning

In CAN, while the specified period is not guaranteed in the Low state, in the High state it is.

However, only those messages that are critical for external devices should be set as high priority, as this may disrupt the proper functioning of Veronte Autopilot 1x.

On the one hand, Autopilot 1x has the producers shown below:

  • Serial to CAN: Serial messages over CAN output, it has to be connected to I/O Setup consumer. It can be configured in the configuration button ( gears icon), a pop-up window will appear:

    ../../../_images/serial_to_can.png

    Serial to CAN configuration

    • Id: CAN Id must be set and it is used to identify messages. The value set has to be decimal format.

    • Extended: If enabled, the frame format will be this, ‘Extended’, i.e. with a 29-bit identifier. Otherwise, the frame format ‘Standard’ (11-bit identifier) is set by default.

    • Time out: This is the threshold time between receptions to consider that it is not being received correctly.

  • CAN custom message: CAN custom messages transmission. They are configured in the Custom message tabs, explained in Custom Messages section.

  • Input filter: CAN input filters. Those CAN messages received in one filter can no longer be received in subsequent filters. Input filter must be configured in the configuration button ( gears icon), a pop-up window will appear:

    ../../../_images/input_filter.png

    Input filter configuration

    • Port: It is required to configure the CAN bus from which it listens, the user can choose between CAN A, CAN B or BOTH.

    • Id: CAN Id must be set and it is used to identify messages. The value set has to be decimal format.

    • Mask: Here a CAN Id mask can be set to filter messages. The mask marks which bits of the message id (in binary) are matched.

      For example, to admit standard Ids (11 bits) from 8 to 11 (100 to 111 in binary) the user should set the mask to binary 11111111100, that is 2044 in decimal.

      Warning

      Make sure that mask is set properly to be able to receive the desired CAN messages.

      The mask should be 11 bits for Standard frame format and 29 bits for Extended frame format.

      More information about this can be found in How to calculate a mask - FAQ section of this manual.

    • Filter type: The options available are Standard, Extended and Both.

  • CAN unwrapper: This undoes the ‘CAN wrapper’ action, it has to be connected to I/O Setup consumer.

  • CAN GPIO remote: CAN messages to GPIO peripherals such as CEX, MEX and Arbiter. It can be configured in the configuration button ( gears icon), a pop-up window will appear:

    ../../../_images/can_gpio_remote.png

    CAN GPIO remote configuration

    • Period: This is the period of sending messages.

    • Id of the generated CAN message: CAN Id must be set and it is used to identify messages.

    • Extended: If enabled, the frame format will be this, ‘Extended’, i.e. with a 29-bit identifier. Otherwise, the frame format ‘Standard’ (11-bit identifier) is set by default.

    • Destination: Here the user select the destination CEX (or other Veronte peripheral) pins.

    • Value: The user must select the 1x pin to be connected to the CEX (or other Veronte peripheral) pin.

  • CAN 4x: CAN message transmission already configured for correct communication between the Autopilots 1x within the Veronte Autopilot 4x. If the user has any questions, please contact the support team following the Joint Collaboration Framework.

On the other hand, the consumers are the following:

  • CAN to serial: This undoes the ‘Serial to CAN’ action, it has to be connected to I/O Setup producer.

  • Custom message: CAN custom messages reception. They are configured in the Custom message panels, explained in Custom Messages section.

  • Output filter: CAN output filters. The user can choose between CAN A, CAN B or BOTH in the configuration button ( gears icon).

    ../../../_images/output_filter.png

    Output filter configuration

  • CAN wrapper: CAN messages over serial output, it has to be connected to I/O Setup producer.

  • CAN 4x: CAN message reception already configured for correct communication between the Autopilots 1x within the Veronte Autopilot 4x. If the user has any questions, please contact the support team following the Joint Collaboration Framework.

Custom Messages

In the custom message tabs (there are 3 available), the user chooses the variables to be sent/received over the CAN buses. The following elements can be configured:

  • TX Ini: Used to configure transmitted messages that are only sent once at the beginning of the operation (sent when the autopilot boots up). They can be used to initialize some devices.

  • TX: Used to configure transmitted messages.

  • RX: Used to configure the reception messages (where they are stored).

Warning

  • The maximum capacity of a CAN message is 64 bits (8 bytes), so to send more information it must be divided into several messages.

  • Autopilot 1x has a CAN limitation of 40 TX messages per Custom, 40 TX Ini messages per Custom and 80 RX messages per Custom.

    In addition, there is a limit shared with all Customs, including RS Custom Messages:

    • Maximum number of vectors (fieldset): 104

    • Maximum number of fields: 2000

../../../_images/can_custom_message.png

Custom Message panel

TX/TX Ini Messages

../../../_images/custom_message_tx.png

CAN Custom Message - TX

In order to add a new custom message the user needs to press add and a new element will be added into the panel.

  1. Period: This is the time in seconds between TX messages delivery.

  2. Endianness: The endianness of the message must be configured, which indicates how the bytes that it contains are sent/read:

    • Big endian: Set the value from left to right.

    • Little endian: Set the value from right to left.

    • Mixed endian: Some devices use this format. If users need to configure it, please contact the support team (create a ticket in the customer’s Joint Collaboration Framework; for more information, see Tickets section of the JCF manual).

  3. Can id: 11-bits (Standard) or 29-bits (Extended) ID used to identify TX messages. The value set has to be decimal format.

  4. Ext: If enabled, the frame format will be ‘Extended’, i.e. with a 29-bit identifier. Otherwise, the frame format ‘Standard’ (11-bit identifier) is set by default.

  5. Copy: This message will be duplicated.

  6. Edit edit_list: Displays the menu to configure how the bits/bytes of the message are divided and sent.

    There are six different options that can be added when setting up a custom message: Variable, Checksum, Matcher, Skip, Parse ASCII and Position.

    The explanation of how to configure these different types of custom messages is detailed in the following section \(\Rightarrow\) Custom Messages types.

RX Messages

The procedure is similar to the one followed in TX messages.

../../../_images/custom_message_rx.png

CAN Custom Message - RX

The options and parameters to configure here are almost the same as those described in TX/TX Ini Messages above, except for one:

  • Can id: The custom message needs to have the expected ID with which the external device/sensor is going to be sending information.

    Attention

    It is important to configure a mailbox for every single reception ID. See Mailboxes section for more information.

Also, unlike TX messages there is two additional variables per message:

  • Time out: for RX messages. This is the threshold time between receptions to consider that it is not being received correctly. For example, if time out is set to 1s and it passes more than 1s since the last reception, the Bit ID will be set to false.

  • Bit ID: The user bit selected in Bit ID box will be true if the message is being received correctly.

    Warning

    Pay attention that the user bit selected in Bit ID is not in use for another task.

The custom message structure needs to match the reception data-format. User variables (real - 32 bits , integer - 16 bits or boolean - 1 bit) may be used to store that data.

Mailboxes

Main screen to configure baudrate and reception mailboxes of each CAN bus (CAN A or CAN B) and enable an internal CAN resistor.

Since Veronte Autopilot 1x is going to receive data on the CAN Bus, it is mandatory to configure a certain number of mailboxes to store that data until Autopilot 1x reads it. A mailbox can be configured for multiple CAN message IDs as long as the mask is configured correctly and these messages are sent spaced out with enough time between them to allow the high priority core to read each one individually. More information on masks can be found in How to calculate a mask - FAQ section of this manual.

Warning

Since 1x PDI Builder allows up tp 32 mailboxes, users should make sure to leave at least one mailbox free for transmission (TX).

If any mailbox is full and another message arrives, the new message is discarded.

../../../_images/mailboxes.png

Mailboxes panel

In order to add a mailbox, press the add icon.

The configurable parameters when adding a new mailbox are:

  1. Mailboxes: Number of mailboxes assigned to that ID.

  2. Extended: If enabled, the frame format will be this, ‘Extended’, i.e. with a 29-bit identifier. Otherwise, the frame format ‘Standard’ (11-bit identifier) is set by default.

  3. ID: 11-bits (Standard) or 29-bits (Extended) ID used to identify RX messages. The value set can be defined in different units, this is configured in (5).

  4. Mask: This filter is configured for reception messages; received data will be stored on mailboxes where message ID coincides with mailbox ID.

    Mask adds some flexibility on the reception, when comparing message with mailbox data, only the value of binary digits configured as 1 on the mask will be taken into account. The value set can be defined in different units, this is configured in (6).

    For example, for a configuration mask: 11 000 and ID: 10 110, all incoming messages addressed to 10 XXX will be received in this mailbox.

    Warning

    Make sure that mask is set properly to be able to receive the desired CAN messages.

    The mask should be 11 bits for Standard frame format and 29 bits for Extended frame format.

    More information about this can be found in How to calculate a mask - FAQ section of this manual.

  5. Units ID: Units available are Decimal, Hexadecimal or Binary.

  6. Units Mask: Units available are Decimal, Hexadecimal or Binary.

  7. Baudrate: CAN Baudrate can be configured here.

  8. Enable Terminator: By activating it, the internal Autopilot 1x resistor of 120 \(\Omega\) is activated.

    Error

    This is not available for all hardware versions. It will be available from a specific hardware version (from hwv 4.8.X and above).

    For more information on this issue, please contact the support team following the user’s Joint Collaboration Framework or the sales team, via sales@embention.com.

Example

Regarding the configuration of masks for mailboxes, it is possible to have only 1 mailbox for the reception of several messages in order to have more mailboxes available.

To do so, let’s take as an example the configuration in the image above, with ID: 0010 0101 1000 (600 in DEC) and Mask: 1111 1111 1100, all incoming messages addressed to 0010 0101 10XX will be received in this mailbox.

This is because the mask that has been configured, looks for the first 10 bits to match the configured ID, and ignores the last 2 bits.

So, the following messages with CAN ID 600, 601, 602 and 603 could be stored in this mailbox (one at time), because:

  • 600 DEC in Binary is \(\Rightarrow\) 0010 0101 1000

  • 601 DEC in Binary is \(\Rightarrow\) 0010 0101 1001

  • 602 DEC in Binary is \(\Rightarrow\) 0010 0101 1010

  • 603 DEC in Binary is \(\Rightarrow\) 0010 0101 1011

../../../_images/mailboxes_example.png

Mailboxes panel - Mask example